package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.HaoyouhongbaoMapper;
import com.ruoyi.system.domain.Haoyouhongbao;
import com.ruoyi.system.service.IHaoyouhongbaoService;
import com.ruoyi.common.support.Convert;

/**
 * 好友下载红包 服务层实现
 * 
 * @author ruoyi
 * @date 2019-07-16
 */
@Service
public class HaoyouhongbaoServiceImpl implements IHaoyouhongbaoService 
{
	@Autowired
	private HaoyouhongbaoMapper haoyouhongbaoMapper;

	/**
     * 查询好友下载红包信息
     * 
     * @param haoyouhongbaoId 好友下载红包ID
     * @return 好友下载红包信息
     */
    @Override
	public Haoyouhongbao selectHaoyouhongbaoById(Integer haoyouhongbaoId)
	{
	    return haoyouhongbaoMapper.selectHaoyouhongbaoById(haoyouhongbaoId);
	}
	
	/**
     * 查询好友下载红包列表
     * 
     * @param haoyouhongbao 好友下载红包信息
     * @return 好友下载红包集合
     */
	@Override
	public List<Haoyouhongbao> selectHaoyouhongbaoList(Haoyouhongbao haoyouhongbao)
	{
	    return haoyouhongbaoMapper.selectHaoyouhongbaoList(haoyouhongbao);
	}
	
    /**
     * 新增好友下载红包
     * 
     * @param haoyouhongbao 好友下载红包信息
     * @return 结果
     */
	@Override
	public int insertHaoyouhongbao(Haoyouhongbao haoyouhongbao)
	{
	    return haoyouhongbaoMapper.insertHaoyouhongbao(haoyouhongbao);
	}
	
	/**
     * 修改好友下载红包
     * 
     * @param haoyouhongbao 好友下载红包信息
     * @return 结果
     */
	@Override
	public int updateHaoyouhongbao(Haoyouhongbao haoyouhongbao)
	{
	    return haoyouhongbaoMapper.updateHaoyouhongbao(haoyouhongbao);
	}

	/**
     * 删除好友下载红包对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteHaoyouhongbaoByIds(String ids)
	{
		return haoyouhongbaoMapper.deleteHaoyouhongbaoByIds(Convert.toStrArray(ids));
	}
	
}
